package com.boang.service;

import com.boang.entity.Cla;
import com.boang.entity.Student;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import java.sql.SQLException;
import java.util.List;

import static org.junit.jupiter.api.Assertions.*;

class StuServiceTest {

    private StuService stuService;
    @BeforeEach
    public void before(){
        stuService = new StuService();
    }
    @Test
    void addstu() throws SQLException {
        StuService stuService = new StuService();
        Student student = new Student(22, "kele",23,"男",,520.12,"medium",78);
        int i = stuService.addStu(student);
        System.out.println(i);
    }
    @Test
    void removeStu() throws SQLException {
        StuService stuService = new StuService();
        stuService.removeStu(3);
    }
    @Test
    void updetaStu() throws SQLException {
        Student student= new Student(1, "可乐");
        stuService.updetaStu(student);
    }

    @Test
    void list() throws SQLException {
        StuService stuService = new StuService();
        List<Student> list = stuService.list();
        list.forEach(System.out::println);
    }
}